#include "neurnet.h"
#include "EasyBMP.h"

class Image
{
private:
	double**	samples;
	double**	samplesR;
	double**	samplesG;
	double**	samplesB;
	double**	results;
	double**	resultsR;
	double**	resultsG;
	double**	resultsB;

	int		allocatedSamples;
	int		allocatedSamplesR;
	int		allocatedSamplesG;
	int		allocatedSamplesB;
	int		allocatedResults;
	int		allocatedResultsR;
	int		allocatedResultsG;
	int		allocatedResultsB;
	
	int		h,w;

	NeuralNetwork* currentR;
	NeuralNetwork* currentG;
	NeuralNetwork* currentB;
	NeuralNetwork* current;

	int		allocatedCurrent;
	int		allocatedCurrentR;
	int		allocatedCurrentG;
	int		allocatedCurrentB;

	int OpenOutputBMP(int color, char* outputFile, int verboose);
	int OpenInputBMP(int color, char* inputFile,int verboose);
	int OpenInputNN(char* fileIn, char* fileOut, int verboose);

	int color;

	BMP		fileBMP;
public:
	~Image();
	Image();
	// transform image from BMP to NN
	int fromBMPtoNN(char* fileIn, char* fileOut, int color, int hidden_neurons, int max_seconds, int max_iter, int min_snr, int start_eta, int verboose);
	int fromNNtoBMP(char* fileIn, char* fileOut, int verboose);

};
